//
//  HNTabBarController.m
//  优学荟管理系统
//
//  Created by edz on 2018/1/5.
//  Copyright © 2018年 星道三好. All rights reserved.
//

#import "HNTabBarController.h"
#import "OrdinaryHomeVC.h"
#import "ZYRegularCheckInController.h"
#import "ZYNewThreeGoodCommentController.h"
@interface HNTabBarController ()

@end

@implementation HNTabBarController

+ (instancetype)TabBarController {
 
    return [[self alloc] init];
}




- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    
    
    
    
    OrdinaryHomeVC *VC1 = [[OrdinaryHomeVC alloc] init];
    VC1.tabBarItem.title = @"首页";
    VC1.tabBarItem.image = [[UIImage imageNamed:@"home_icon_home_fault_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [VC1.tabBarItem setSelectedImage:[[UIImage imageNamed:@"home_icon_home_seleted_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];//选中图片
    XDNavigationController *NV1 = [[XDNavigationController alloc] initWithRootViewController:VC1];
    VC1.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTargat:self action:@selector(Pop) image:@"nav_icon_back_default" highImage:@"nav_icon_back_default"];
    
    ZYRegularCheckInController *VC2 = [[ZYRegularCheckInController alloc] init];
    VC2.title = @"签到";
    VC2.tabBarItem.image = [[UIImage imageNamed:@"icon_sign_in_default_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [VC2.tabBarItem setSelectedImage:[[UIImage imageNamed:@"icon_sign_in_seleted_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];//选中图片
    XDNavigationController *NV2 = [[XDNavigationController alloc] initWithRootViewController:VC2];
    VC2.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTargat:self action:@selector(Pop) image:@"nav_icon_back_default" highImage:@"nav_icon_back_default"];
    
    
    ZYNewThreeGoodCommentController *VC3 = [[ZYNewThreeGoodCommentController alloc] init];
    VC3.title = @"三好评价";
    VC3.tabBarItem.image = [[UIImage imageNamed:@"icon_competition_default_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [VC3.tabBarItem setSelectedImage:[[UIImage imageNamed:@"icon_competition_seleted_TabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];//选中图片
    XDNavigationController *NV3 = [[XDNavigationController alloc] initWithRootViewController:VC3];
    VC3.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTargat:self action:@selector(Pop) image:@"nav_icon_back_default" highImage:@"nav_icon_back_default"];
    
    self.viewControllers = @[NV1, NV2, NV3];
    
    
    // 字体颜色
    NSMutableDictionary *attr3=[NSMutableDictionary dictionary];
    attr3[NSForegroundColorAttributeName]=[UIColor lightGrayColor];
    attr3[NSFontAttributeName]=[UIFont systemFontOfSize:12];
    [[UITabBarItem appearance]setTitleTextAttributes:attr3 forState:UIControlStateNormal];
    
    NSMutableDictionary *attr4=[NSMutableDictionary dictionary];
    attr4[NSForegroundColorAttributeName]=ColorRGB(102, 200, 137);
    attr4[NSFontAttributeName]=[UIFont systemFontOfSize:12];
    [[UITabBarItem appearance]setTitleTextAttributes:attr4 forState:UIControlStateSelected];
}

- (void)Pop {
    
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"loginState"];
    AppDelegate.DeleteJPUSH_Tag();

    [self dismissViewControllerAnimated:YES completion:nil];
}



@end
